fix memory link in gpx reader.
authortsteven4 <tsteven4@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 8 Aug 2013 02:14:49 +0000 (02:14 +0000)
committertsteven4 <tsteven4@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 8 Aug 2013 02:14:49 +0000 (02:14 +0000)
eliminate unused var in csv_util.

git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4521 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/csv_util.cc
gpsbabel/gpx.cc

index 9c3792e5ace40d627963850f05961675ad984546..3c8700cfaeb30e56a2ab4a7f2d120364b67f9aa8 100644 (file)
@@ -1183,8 +1183,8 @@ xcsv_parse_val(const char* s, waypoint* wpt, const field_map_t* fmp,
     wpt->SetCreationTime(xml_parse_time(s));
     break;
   case XT_NET_TIME: {
-    time_t tt = wpt->GetCreationTime();
 fatal("XT_NET_TIME can't have possibly ever worked.");
+//    time_t tt = wpt->GetCreationTime();
 //    dotnet_time_to_time_t(atof(s), &tt, &wpt->microseconds);
     }
     break;
index b60cfa8be7673cbec52fbeec7452c7ff154c73f1..582fcbd05619d527e923809759afe5c9aa9c2161 100644 (file)
@@ -965,8 +965,10 @@ gpx_end(void* data, const XML_Char* xml_el)
      * Waypoint-specific tags.
      */
   case tt_wpt:
-    if (link_ && !link_->url_.isEmpty()) {
-      wpt_tmp->AddUrlLink(*link_);
+    if (link_) {
+      if ( !link_->url_.isEmpty()) {
+        wpt_tmp->AddUrlLink(*link_);
+      }
       delete link_;
       link_ = NULL;
     }
@@ -1077,6 +1079,13 @@ gpx_end(void* data, const XML_Char* xml_el)
   case tt_rte:
     break;
   case tt_rte_rtept:
+    if (link_) {
+      if ( !link_->url_.isEmpty()) {
+        wpt_tmp->AddUrlLink(*link_);
+      }
+      delete link_;
+      link_ = NULL;
+    }
     route_add_wpt(rte_head, wpt_tmp);
     wpt_tmp = NULL;
     break;
@@ -1098,6 +1107,13 @@ gpx_end(void* data, const XML_Char* xml_el)
     next_trkpt_is_new_seg = 1;
     break;
   case tt_trk_trkseg_trkpt:
+    if (link_) {
+      if ( !link_->url_.isEmpty()) {
+        wpt_tmp->AddUrlLink(*link_);
+      }
+      delete link_;
+      link_ = NULL;
+    }
     track_add_wpt(trk_head, wpt_tmp);
     wpt_tmp = NULL;
     break;